package edu.gatech.volt2.drdoommgt.tests;

import static org.junit.Assert.assertTrue;

import java.util.ArrayList;
import java.util.List;

import org.junit.Test;

import edu.gatech.volt2.drdoommgt.domain.DocOrder;
import edu.gatech.volt2.drdoommgt.domain.Doctor;
import edu.gatech.volt2.drdoommgt.domain.Labwork;
import edu.gatech.volt2.drdoommgt.domain.Name;
import edu.gatech.volt2.drdoommgt.domain.Nurse;
import edu.gatech.volt2.drdoommgt.domain.Prescription;
import edu.gatech.volt2.drdoommgt.domain.TreatmentRecord;
import edu.gatech.volt2.drdoommgt.domain.VitalSigns;
import edu.gatech.volt2.drdoommgt.system.DataBaseAccessor;


public class TreatmentRecordTest {

	@Test public void saveTR(){
		
		VitalSigns vs = new VitalSigns("120/60", 60, 98.6, 6, 2, 190);
		
		assertTrue(true);
		ArrayList<Prescription> presc_list = new ArrayList<Prescription>();
		assertTrue(presc_list.isEmpty());
		presc_list.add(new Prescription("Tylonal", "Inject", 200.34));
		presc_list.add(new Prescription("Asprin", "Pill", 5.99));

		ArrayList<Labwork> lab_list = new ArrayList<Labwork>();
		lab_list.add(new Labwork());
		lab_list.add(new Labwork());
		System.out.println("Labs");

		
		DocOrder d_o = new DocOrder("Not nessisary", "Other info", 
				presc_list, lab_list);
		
		
		System.out.println("Doc_order");

		
		Nurse attending_nurse = new Nurse(new Name("Someone", "Nurse"));
		Doctor trating_doc = new Doctor(new Name("Doctor", "Smart"));
		
		
		System.out.print("Nurse Doc.");

		TreatmentRecord tr= new TreatmentRecord(vs, d_o, trating_doc, attending_nurse, "head hurts", "headache");

		// Create connection
		DataBaseAccessor db = new DataBaseAccessor("testing");
		db.connectToDatabase();
		
		assertTrue(db.createTreatmentRecord(tr));
		// Close Connection
		db.closeConnectionToDatabase();
		
		assertTrue(true);

	}
}
